﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace XFControls
{
    public partial class XFItem : UserControl
    {
        private Bitmap picture;
        public Bitmap Picture
        {
            get
            {
                return picture;
            }
            set
            {
                picture = value;
                pictureBox.Image = picture;
                pictureBox.Refresh();
            }
        }

        private String name;
        public String Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
                LabelName.Text = name;
                LabelName.Refresh();
            }
        }

        private String message;
        public String Message
        {
            get
            {
                return message;
            }
            set
            {
                message = value;
                LabelMessage.Text = message;
                LabelMessage.Refresh();
            }
        }

        private DateTime timeAgo;
        public DateTime TimeAgo
        {
            get
            {
                return timeAgo;
            }
            set
            {
                timeAgo = value;
                LabelTimeAgo.Text = timeAgo.Hour.ToString() + " hours ago";
                LabelTimeAgo.Refresh();
            }
        }

        private int nbComments;
        public int NbComments
        {
            get
            {
                return nbComments;
            }
            set
            {
                nbComments = value;
                LabelNbComments.Text = nbComments + " comments";
                LabelNbComments.Refresh();
            }
        }

        private int nbLikes;
        public int NbLikes
        {
            get
            {
                return nbLikes;
            }
            set
            {
                nbLikes = value;
                LabelNbLikes.Text = nbLikes + " likes";
                LabelNbLikes.Refresh();
            }
        }


        public XFItem()
        {
            InitializeComponent();
        }
    }
}
